From pdxgate!reed!batcomputer!rpi!zaphod.mps.ohio-state.edu!cs.utexas.edu!uunet!noc.near.net!hri.com!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!aun.uninett.no!nuug!ifi.uio.no!larshaug Thu Dec 17 16:43:26 PST 1992 Article 1577 of alt.sys.amiga.demos: Path: pdxgate!reed!batcomputer!rpi!zaphod.mps.ohio-state.edu!cs.utexas.edu!uunet!noc.near.net!hri.com!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!aun.uninett.no!nuug!ifi.uio.no!larshaug >From: larshaug@ifi.uio.no (Lars Haugseth) Newsgroups: alt.sys.amiga.demos Subject: Source : Horizontal scroller Message-ID: <1992Dec12.193243.14082@ifi.uio.no> Date: 12 Dec 92 19:32:43 GMT Sender: larshaug@ifi.uio.no (Lars Haugseth) Organization: Dept. of Informatics, University of Oslo, Norway Lines: 403 Nntp-Posting-Host: yrsa.ifi.uio.no Originator: larshaug@yrsa.ifi.uio.no It's time to hit the hardware again, and maybe earn some more flames. 8) Ok, here is small program I made that simply scrolls a 5 bitplane 320x256 pixels picture leftwards, and inserts new graphics at the right edge of the screen. The graphics are built up by 16x16 pixel blocks. I have included some example block-data as a uuencoded LhA-archive. (Separate posting) The scrolling works as follows: After smooth-scrolling the picture 16 pixel with the BLTCON1 register, I add 2 bytes to the bitplane-pointers, and blit new blocks into the memory which lies off the right edge of the screen. It's as simple as that. It's very simple to extend the program to scroll in both directions, but that part you must figure out yourselves. The memory usage for the graphics are [ SW * (SH + MX) ] bytes, where SW is the screenwidth in bytes, SH is the screenheight in pixels, and MX is the maximum number of screenwidths you can scroll. I have set MX=32, which means you can scroll 352x32 pixels, which should be more than enough for most vertical scrolling games. Time usage is about 4 rasterlines pr.frame when scrolling 1 pixel at a time. If you'd like to scroll more pixel pr.frame, the time increases, but it's still pretty fast. +-----------------------------------------------------------+ | Lars Haugseth +-+ | Dept. of Informatics, | | | University of Oslo, Norway | | | | | | If idiots could fly, this would be an airport... | | +-+---------------------------------------------------------+ | +-----------------------------------------------------------+